﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

    <div class="dung-round">
    <p>
        <input id="statuslist" type="hidden" value="all"/>
        <label><b>Tên đăng nhập</b></label>
        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input id="searchUserName" type="text" class="dung-textbox" size="30" maxlength="30" />
        
        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <label><b>Tên người dùng</b></label>
        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input id="searchFullName" class="dung-textbox" type="text" size="40" maxlength="50" />

        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input id="btnSearch" class="dung-button" value="Tìm kiếm" type="button" onclick="search(1)" />

        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input id="btnViewAll" class="dung-button" value="Xem tất cả" type="button" onclick="viewall(1)" />
    </p>
    </div>
    <script type="text/javascript">

        function search(pageindex) {
            $("#statuslist").val("search");
            $.get("/User/List/" + '0' + "?pPageIndex=" + pageindex + "&userName=" + $("#searchUserName").val() + "&fullname=" + $("#searchFullName").val(),
                function (data) {
                    $('#medialist').fadeOut();
                    $('#medialist').html(data);
                    $('#medialist').fadeIn();
                }
            );
        }

        function viewall(pageindex) {
            $("#statuslist").val("all");
            $("#searchUserName").val("");
            $("#searchFullName").val("");
            $.get("/User/List/" + '0' + "?pPageIndex=" + pageindex + "&userName=" + $("#searchUserName").val() + "&fullname=" + $("#searchFullName").val(),
                function (data) {
                    $('#medialist').fadeOut();
                    $('#medialist').html(data);
                    $('#medialist').fadeIn();
                }
            );
        }

    </script>